
function addData() { 
	
	var UrlCheckIn = 'admin/checkin_queryCheckIn.action?pageFinder.pageNo=1';
	   
	if($("#academyName").val()!=""){
		UrlCheckIn = UrlCheckIn+"&pageing.academy="+$("#academyName").val();
	 }
	if($("#className").val()!=""){
		UrlCheckIn = UrlCheckIn+"&pageing.stuClass="+$("#className").val();
	 }
	if($("#courseName").val()!=""){
		UrlCheckIn = UrlCheckIn+"&pageing.course="+$("#courseName").val();
		 
	 }
	console.log(UrlCheckIn);
	//查询考勤
	$.ajax({
        type: "get",
        cache: false,
        url: UrlCheckIn,
        dataType: "json",
        success: function (result) {
       	 var json= eval("("+result+")")["dataList"];
       	
        var table1 = $("#voCheckIn");
        table1.find("tr[name='trc']").remove();
        var firstTr = table1.find("tbody>tr:first");
        var i = 0;
       	 $.each(json,function(index,content){
       		 i++;
       		var vo ="<div class='button-group' name='checks'>" +
			"<a class='button border-main'  href='javascript:void(0)'>" 
			+"<input type='radio'   name='CheckList"+index+"' onclick='selectCheck(this)' value='0|"+content.id+"' checked='checked' /> 正常</a>" +
			"<a class='button border-main'  href='javascript:void(0)'>"
	        +"<input type='radio'  name='CheckList"+index+"' onclick='selectCheck(this)' value='1|"+content.id+"'   /> 迟到</a>" +
	        "<a class='button border-main' href='javascript:void(0)'>"
	        +"<input type='radio'  name='CheckList"+index+"'  onclick='selectCheck(this)' value='2|"+content.id+"' /> 请假</a>" +
	        "<a class='button border-red' href='javascript:void(0)'>"
	        +"<input type='radio'  name='CheckList"+index+"' onclick='selectCheck(this)' value='3|"+content.id+"'  /> 旷课</a>" +
			"</div>";
       		var row = $("<tr name='trc'></tr>");
            var td_1 = $( "<td>"+content.stuClass+"</td>");
            var td_2 = $( "<td>"+content.course+"</td>");
            var td_3 = $( "<td>"+content.stuNo+"</td>");
            var td_4 = $( "<td width='10%'><font color='#00CC99' size='5px'>"+content.stuName+"</font></td>");
            var td_5 = $( "<td>"+vo+"</td>");
            var td_6 = $( "<td>"+content.vacate+"</td>");
            var td_7 = $( "<td>"+content.beLate+"</td>");
            var td_8 = $( "<td>"+content.truancy+"</td>");
           
       		
       		row.append(td_1);
       		row.append(td_2);
            row.append(td_3);
            row.append(td_4);
            row.append(td_5);
            row.append(td_6);
            row.append(td_7);
            row.append(td_8);
            table1.append(row);
            
       		 });
       	var row1 = $("<tr name='trc'></tr>");
       	 var td_9 = $( "<td colspan='8'><div class='pagelist'>"
                 +"<a href='javascript:void(0)' class='button border-main icon-plus-square-o"+ 
                 "style='padding:5px 15px;' onclick='submitSelect()'> 提交</a></td></div></td>");
                 row1.append(td_9);
                 table1.append(row1);        
       	 $("#voCheckIn").html();
       	 $("#sum").attr('value',i);
       	 i=0;
        },
        error: function (result) {
          console.log(result);
        }
    }

    );
}
//随机数
function getRandom(n){
    return Math.floor(Math.random()*n+1)
    }
function ListData() { 
	
	   $("#voCheckIn tr").each(function(trindex,tritem){
           	 $(tritem).show();
       });
        $("#voCheckIn tr").each(function(trindex,tritem){
            if(getRandom(2)==1&&trindex!=0){
            	 $(tritem).hide();
            }
        });
        $("#voCheckIn").find("tr:last").show();
       
}